package com.springboot.service.impl;

import com.springboot.mapper.MessageInformMapper;
import com.springboot.model.MessageInform;
import com.springboot.service.DoctorUnreadToReadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 本业务用于医生将消息设置为已读
 */
@Service
public class DoctorUnreadToReadServiceImpl implements DoctorUnreadToReadService {
    @Autowired
    private MessageInformMapper messageInformMapper;

    //通过消息编号查找消息记录
    @Override
    public MessageInform findMessageById(Integer messageId)
    {
        MessageInform messageInform=messageInformMapper.selectByPrimaryKey(messageId);
        return messageInform;
    }

    //更新这条消息记录
    @Override
    public int updateMessageState(MessageInform messageInform)
    {
        return messageInformMapper.updateByPrimaryKeySelective(messageInform);
    }
}
